import com.sun.java.swing.plaf.windows.WindowsInternalFrameTitlePane;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wx
 * Date: 2023-07-25
 * Time: 17:29
 */
public class Test {
    //今日练习以达成
    //输出乘法口诀表
    public static void main7(String[] args) {
                Scanner Scanner = new Scanner(System.in);
                int m = Scanner.nextInt();
        for (int i = 1; i <=m ; i++) {
            for (int j = 1; j <=i ; j++) {
                System.out.print(i+"*"+j+"="+i*j+" ");

                          }
            System.out.println();
        }
    }

    //编写代码模拟三次密码输入的场景。
    // 最多能输入三次密码，密码正确，提示“登录成功”；
    // 密码错误，可以重新输入，最多输入三次。
    // 三次均错，则提示退出程序

    public static void main6(String[] args) {
        Scanner Scanner = new Scanner(System.in);
        int m = Scanner.nextInt();
        int k = 12345;
        int flg = 0;
        while (flg != 2) {
            if (m != k) {
                System.out.println("请重新输入");
                flg++;
                m = Scanner.nextInt();
                if(m==k) {
                    System.out.println("输入正确，恭喜登录成功");
                    break;
                }
            }
        }
        if(m!=k)
        System.out.println("退出程序");
    }


    //打印 X 图形
    public static void main5(String[] args) {
        Scanner Scanner = new Scanner(System.in);
        int m = Scanner.nextInt();
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < m; j++) {
                if (i == j|| i+j == (m-1)) {
                    System.out.print("*");
                } else {
                    System.out.print(" ");

                }
            }
                System.out.print("\n");
        }
    }




    //计算1/1-1/2+1/3-1/4+1/5 …… + 1/99 - 1/100 的值
    public static void main4 (String[] args) {
        int flg = 1;
        double ret = 0;
        for (double i = 1.0; i <= 100 ; i++) {
            ret += flg *(1 /i);
            flg = -flg;
        }
        System.out.println(ret);
    }


    //给定两个数，求这两个数的最大公约数
    public static void main3 (String[] args) {
        Scanner Scanner = new Scanner(System.in);

        int m = Scanner.nextInt();
        int n = Scanner.nextInt();
        int k = 0;
        if (m > n) {
            k = n;
        } else {
            k = m;
        }
        while (true) {
            if (m % k == 0 && n % k == 0){
                System.out.println(k);
                break;
            }
            k--;
        }
    }


        //给定一个数字，判定一个数字是否是素数
    public static void main2(String[] args) {
        Scanner Scanner = new Scanner(System.in);
        int m = Scanner.nextInt();
        boolean flg = true;
        for (int j = 2; j < m; j++) {
            if (m % j == 0) {
                flg = false;
                break;
            }
        }
        if(flg = true){
            System.out.println("是素数");
        }
       if(flg = false )
        System.out.println("是素数");
    }




    //编写程序数一下 1到 100 的所有整数中出现多少个数字9
    public static void main1(String[] args) {
        int i = 0;
        int count = 0;
        for(i = 0 ; i <= 100 ; i++) {
            if(i < 10 && i % 9 == 0) {
                count = 1;
                }
            if (i > 10 && i % 10 == 9) {
             count++;
            }
        }
        System.out.println(count);
    }
}
